<template>
    <dialogs
        :visible="visible"
        title="添加药店"
        width="800px"
        @confirm="confirm"
        confirmText="添加"
    >
        <search-form :searchArray="searchArray"></search-form>
        <elTable :formData="formData" @tableData="getList" ref="dataInfos">
                 <el-table-column prop="name" align="center"
                 type="selection"
                  width="55"
                ></el-table-column>
                <el-table-column prop="name" label="药店名称" ></el-table-column>
        </elTable>
    </dialogs>
</template>
<script>
import elTable from "@/components/xForm/elTable"
export default {
    name: 'shopCompany',
    components: {
        elTable
    },
    props: {
        visible: {
            type: Object,
            default () {
                return {
                    show: true
                }
            }
        }
    },
    data () {
        return {
            searchArray: [
                {
                    type: "input",
                    placeholder: "请输入药店名称",
                    types: "text",
                    value: "",
                    label: "药店"
                }
            ],
            formData: {
                name: "",
                userName: "",
                userStatus: "",
                currentPage: 1,
                pageSize: 10,
            },
        }
    },
    methods: {
        getList(pageNo) {
            let dataInfo = [
                {
                    id: 1,
                    name: "你好",
                    createTime: '1595244696000'
                },
                {
                    id: 2,
                    name: "你好1",
                    createTime: '1595244696000'
                },
            ];
            let total = 10;
            this.$nextTick(() => {
                this.$refs.dataInfos.loadData(dataInfo, total);
            });
        },
        confirm () {
            this.$emit('confirm')
        }
    }
}
</script>